package com.fay.cleancode;

/**
 * @Title:
 * @Description:
 * @Author Fay Wang
 * @Date 2022/4/17 21:26
 * @Version 1.0
 */
public class Demo2 {

    public static void main(String[] args) {
        new Demo2().printGuessStatistics('a', 0);
    }

    private void printGuessStatistics(char candidate, int count) {
        String number;
        String verb;
        String pluralModifier;

        if (count == 0) {
            number = "no";
            verb = "are";
            pluralModifier = "s";
        } else if (count == 1) {
            number = "1";
            verb = "is";
            pluralModifier = "";
        } else {
            number = Integer.toString(count);
            verb = "are";
            pluralModifier = "s";
        }
        String guessMessage = String.format("There %s %s", verb, number, candidate, pluralModifier);
        System.out.println(guessMessage);
    }
}
